home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 23 / AMIGAplus Sonderheft 23 (2000)(Falke)(DE)[!].iso / Updates / HD-Installer / DungeonMasterHD / Install_Game < prev    next >
Text File  |  1999-11-08  |  4KB  |  190 lines

  1. ;****************************
  2.  
  3. (set #readme-file "DungeonMaster.readme") ;name of readme file
  4. (set #last-disk 1)          ;amount of disks
  5. (set #disk-size 901120)     ;size of each disk
  6.  
  7. ;****************************
  8. ;----------------------------
  9. ; Checks if given program is reachable via the path
  10. ; if not abort install
  11. ; IN:  #program - to check
  12. ; OUT: -
  13.  
  14. (procedure P_chkrun
  15.   (if
  16.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  17.     ("")
  18.     (abort ("You must install \"%s\" first !\nIt must be accessible via the path.\nYou can find it in the whdload package." #program))
  19.   )
  20. )
  21.  
  22. ;----------------------------
  23. ; Create disk-Image using DIC
  24. ; IN:  #dest        - DestinationPath
  25. ;      #CI_diskname - DiskName
  26. ;      #CI_diskno   - DiskNumber
  27. ;      #CI_drive    - DriveToReadFrom
  28. ; OUT: -
  29.  
  30. (procedure P_image
  31.   (message ("\nInsert \"%s\" into drive %s !\n\n(make sure it's the right disk because it will not checked)" #CI_diskname #CI_drive))
  32.   (if
  33.     (= 0 
  34.       (run ("cd \"%s\"\nDIC %s FD=%ld LD=%ld SIZE=%ld >CON:///1000//CLOSE" #dest #CI_drive #CI_diskno #CI_diskno #disk-size))
  35.     )
  36.     ("")
  37.     (abort "\"DIC\" has failed to create a diskimage")
  38.   )
  39. )
  40.  
  41. ;****************************
  42.  
  43. (if
  44.   (exists #readme-file)
  45.   (if
  46.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  47.     ("")
  48.     (run ("SYS:Utilities/More %s" #readme-file))
  49.   )
  50. )
  51.  
  52. (set #program "DIC")
  53. (P_chkrun)
  54.  
  55. ; in expert mode ask for source drive
  56. (if
  57.   (= @user-level 2)
  58.   (
  59.     (set #CI_drive
  60.       (askchoice
  61.     (prompt "Select source drive for diskimages")
  62.     (default 0)
  63.     (choices "DF0:" "DF1:" "RAD:" "Enter Device")
  64.     (help @askchoice-help)
  65.       )
  66.     )
  67.     (select #CI_drive
  68.       (set #CI_drive "DF0:")
  69.       (set #CI_drive "DF1:")
  70.       (set #CI_drive "RAD:")
  71.       (set #CI_drive
  72.         (askstring
  73.           (prompt "Select source drive for diskimages")
  74.           (default "DF0:")
  75.           (help @askstring-help)
  76.         )
  77.       )
  78.     )
  79.   )
  80.   (set #CI_drive "DF0:")
  81. )
  82.  
  83. (set @default-dest
  84.   (askdir
  85.     (prompt ("Where should \"%s\" installed ?\nA drawer \"%s\" will automatically created." @app-name @app-name))
  86.     (help @askdir-help)
  87.     (default @default-dest)
  88.     (disk)
  89.   )
  90. )
  91. (set #dest (tackon @default-dest @app-name))
  92. (if
  93.   (exists #dest)
  94.   (
  95.     (set #choice
  96.       (askbool
  97.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted ?" #dest))
  98.         (default 1)
  99.         (choices "Delete" "Skip")
  100.         (help @askbool-help)
  101.       )
  102.     )
  103.     (if
  104.       (= #choice 1)
  105.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  106.     )
  107.   )
  108. )
  109. (makedir #dest
  110.   (help @makedir-help)
  111.   (infos)
  112. )
  113.  
  114. ;----------------------------
  115.  
  116. (copyfiles
  117.   (help @copyfiles-help)
  118.   (source ("dmmountlist"))
  119.   (dest #dest)
  120. )
  121.  
  122. (copyfiles
  123.   (help @copyfiles-help)
  124.   (source ("dm_fms"))
  125.   (dest #dest)
  126. )
  127.  
  128. (copyfiles
  129.   (help @copyfiles-help)
  130.   (source ("DungeonMaster"))
  131.   (dest #dest)
  132. )
  133.  
  134. (if
  135.   (exists ("%s.newicon" @app-name))
  136.   (set #icon
  137.     (askchoice
  138.       (prompt "\nWhich icon do you like to install ?\n")
  139.       (default 0)
  140.       (choices "Normal" "NewIcon")
  141.       (help @askchoice-help)
  142.     )
  143.   )
  144.   (set #icon 0)
  145. )
  146. (select #icon
  147.   (set #icon ("%s.inf" @app-name))
  148.   (set #icon ("%s.newicon" @app-name))
  149. )
  150. (copyfiles
  151.   (help @copyfiles-help)
  152.   (source #icon)
  153.   (newname ("%s.info" @app-name))
  154.   (dest #dest)
  155. )
  156. (if
  157.   (exists #readme-file)
  158.   (copyfiles
  159.     (help @copyfiles-help)
  160.     (source #readme-file)
  161.     (dest #dest)
  162.     (infos)
  163.   )
  164. )
  165.  
  166. (if
  167.   (exists ("%s.info" #readme-file))
  168.   (copyfiles
  169.     (help @copyfiles-help)
  170.     (source ("%s.info" #readme-file))
  171.     (dest #dest)
  172.   )
  173. )
  174.  
  175. (set #CI_diskno 1)
  176. (while
  177.   (<= #CI_diskno #last-disk)
  178.   (
  179.     (set #CI_diskname ("%s Disk %ld" @app-name #CI_diskno))
  180.     (P_image)
  181.     (run ("FileNote Disk.%ld %s Quiet" #CI_diskno @app-name))
  182.     (rename ("%s/disk.%ld" #dest #CI_diskno) ("%s/UNIT%ld" #dest (- #CI_diskno 1)))
  183.     (set #CI_diskno (+ #CI_diskno 1))
  184.   )
  185. )
  186.  
  187. ;----------------------------
  188.  
  189. (exit)
  190.